package com.blog.backend;


import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.alibaba.nacos.spring.context.annotation.discovery.EnableNacosDiscovery;

import com.blog.backend.interceptor.GlobalInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PreDestroy;
import java.util.List;

@SpringBootApplication
@MapperScan("com.blog.backend.mapper")
@NacosPropertySource(dataId ="blog.yml",autoRefreshed = true)
@EnableNacosDiscovery
@EnableScheduling
public class BackendApplication  {

    private final Logger log =  LoggerFactory.getLogger(this.getClass());

    public static void main(String[] args) {
        SpringApplication.run(BackendApplication.class, args);
    }


    @Bean
    public GlobalInterceptor globalInterceptor(){
        //注入拦截器
        return new GlobalInterceptor();
    }

}
